<%--
  Created by IntelliJ IDEA.
  User: meng
  Date: 2020/5/11
  Time: 12:02
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<% String path = request.getContextPath();%>
<!doctype html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <%--设置页面不缓存--%>
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-cache">
    <meta http-equiv="Expires" content="0">
    <title>简历</title>
    <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
    <script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script>
    <script src="http://cdn.bootcss.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>

    <!-- INCLUDES -->
    <link rel="stylesheet" href="<%=path%>/static/css/web/bootstrap-table-expandable.css">
    <link rel="stylesheet" type="text/css" href="<%=path%>/static/css/web/base.css">
    <style>
        table.table-expandable > tbody > tr div.table-expandable-arrow {
            background:transparent url("<%=path%>/static/images/web/arrows.png") no-repeat scroll 0px -16px;
            width:16px; height:16px; display:block;
            margin-top: 40px;
            margin-left: -50px;
        }
        table tbody tr{height: 100px;}
        table li {list-style: none;}
        /*.cssSelect .selectRt{cursor:pointer;background:url(<%=path%>/static/images/web/skin_icons.png) -49px -160px no-repeat #f2f2f2;
            border-left:1px solid #c8c8c8;float:left}*/
        .schoolId{margin-right: 100px;}
        .startTime{margin-right: 100px;}
        .professionalName{margin-right: 100px;}
        .eduTypeId{margin-right: 10px;}
        table thead tr th{font-size: 20px;font-weight: 700;}
        table tbody b{color: #20c997;}
        table tbody h5{color: #ff6600;margin-bottom: 10px;}

    </style>
</head>
<body>

<div class="container">
    <table class="table table-hover table-expandable">
        <thead>
        <tr>
            <th colspan="4">个人简历模板</th>
            <th><a href="<%=path%>/web/person/personResumeGenerate?resumeId=${requestScope.resumeId}" target="_blank">预览简历</a></th>
            <th><a href="<%=path%>/web/index" title="返回首页">返回首页</a></th>
        </tr>
        <tr>
            <td colspan="6">
                ${sessionScope.person.name}&nbsp;
                <c:if test="${sessionScope.person.sex eq '男'}">
                    <img src="<%=path%>/static/images/web/man.png" style="width: 20px">
                </c:if>
                <c:if test="${sessionScope.person.sex eq '女'}">
                    <img src="<%=path%>/static/images/web/woman.png" style="width: 20px">
                </c:if>
                <span id="age"></span>
                <br><br>手机号:${sessionScope.person.phone}
            </td>
            <th>
                <c:if test="${sessionScope.person.pic==0}">
                    <img src="<%=path%>/static/images/web/uploadimages/0.jpeg" id="relTouXiang" style="width: 40px"/>
                </c:if>
                <c:if test="${sessionScope.person.pic!=0}">
                    <img src="<%=path%>/static/images/web/uploadimages/${sessionScope.person.pic}" id="relTouXiang" style="width: 40px"/>
                </c:if>
            </th>
        </tr>
        </thead>
        <tbody>
        <tr>
            <td colspan="6">
                <b>个人优势</b>
                <br><br>
                <c:if test="${requestScope.advantages!=null}">
                    <span id="advantage">${requestScope.advantages}</span>
                </c:if>
            </td>
            <td>
                <c:if test="${requestScope.advantages!=null}">
                    <img id="del1${sessionScope.person.id}" src="<%=path%>/static/images/web/del.png" style="width: 20px;padding-top: 40px;" title="删除" >
                </c:if>
            </td>
        </tr>
        <tr>
            <td colspan="8">
                <h5>编辑个人优势(最多输入100字)</h5>
                <ul>
                    <li>
                        <textarea rows="5" cols="150" maxlength="100" placeholder="" id="advantages">
                        </textarea>
                    </li>
                </ul>
            </td>
        </tr>

        <tr>
            <td colspan="6" id="xxxx"><%--educationalExperience--%>
                <b>教育经历</b>
                <br><br>
                <c:if test="${requestScope.educationalExperience!=null}">
                    <c:forEach items="${requestScope.educationalExperience}" varStatus="x" var="eduExp">
                    <span>
                    ${x.count}.
                    <span class="schoolId">${eduExp.school.schoolName}</span>
                    <span class="startTime">
                        <fmt:formatDate value="${eduExp.startTime}"></fmt:formatDate>-
                        <fmt:formatDate value="${eduExp.graduationTime}"></fmt:formatDate>
                    </span>
                    <span class="professionalName">${eduExp.professionalName}</span>
                    <span class="eduTypeId">${eduExp.educationalBackgroundType.educationalBackgroundTypeName}</span>
                    <img class="del4${eduExp.id}" src="<%=path%>/static/images/web/del.png" style="width: 20px;padding-top: 0px;" title="删除" >
                    <br><br>
                    </span>
                    </c:forEach>
                </c:if>
            </td>
            <td></td>
        </tr>
        <tr>
            <td colspan="8">
                <h5>添加教育经历</h5>
                <ul>
                    <li id="jiaoYu">
                        <form>
                            <select name="jQuery2" class="beautify_input" id="selectSchool" required>
                                <option>添加学校</option>
                                <c:forEach items="${requestScope.allSchool}" var="school" varStatus="x">
                                    <option value="${school.id}">
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            ${school.schoolName}
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    </option>
                                </c:forEach>
                            </select><br><br><br>

                            开始时间：<input type="date" style="width: 250px" id="sT" required><br><br>
                            毕业时间：<input type="date" style="width: 250px" id="gT" required><br><br><br>
                            在校经历：<textarea rows="3" cols="150" maxlength="200" placeholder="" id="as" required></textarea><br><br>
                            是否全日制:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <input name="sf" class="sf" type="radio" checked value="1">是&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <input name="sf" class="sf" type="radio" value="0">否<br><br>
                            专业名称: <input type="text" id="pn" required><br><br>
                            <select name="jQuery2" class="beautify_input" id="selectEducation" required>
                                <option>学历</option>
                                <c:forEach items="${requestScope.educationalBackgroundTypes}" var="education" varStatus="x">
                                    <option value="${x.count}">
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            ${education.educationalBackgroundTypeName}
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    </option>
                                </c:forEach>
                            </select><br><br><br>
                            <input type="submit" id="sbmit" style="margin-left: 150px;">
                        </form>
                    </li>
                </ul>
            </td>
        </tr>

        <tr>
            <td colspan="6">
                <b>学历</b>
                <br><br>
                <span id="education">
                    <c:if test="${requestScope.education ne '无'}">
                        ${requestScope.education}
                    </c:if>
                </span>
            </td>
            <td>
                <c:if test="${requestScope.education!=''}"></c:if>
                <%--<img id="del3${sessionScope.person.id}" src="<%=path%>/static/images/web/del.png" style="width: 20px;padding-top: 40px;" title="删除" >--%>

            </td>

        </tr>
        <tr>
            <%--<td colspan="8">
                <h5>请选择学历</h5>
                <ul>
                    <li>
                        <select name="jQuery2" class="beautify_input" id="selectEducation">
                            <c:forEach items="${requestScope.educationalBackgroundTypes}" var="education" varStatus="x">
                                <option value="${x.count}">
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                        ${education.educationalBackgroundTypeName}
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                </option>
                            </c:forEach>
                        </select>
                    </li>
                </ul>
            </td>--%>
        </tr>

        <tr>
            <td colspan="6">
                <b>期望职位</b>
                <br><br>
                <span id="position">
                    <c:if test="${requestScope.positionDesired!=null}">
                        <span id="positionTypeId" style="margin-right: 50px">${requestScope.positionDesired.positionType.positionTypeName}</span>
                        <span id="positionId" style="margin-right: 50px">${requestScope.positionDesired.position.positionName}</span>
                        <span id="salaryMin" style="margin-right: 2px">${requestScope.positionDesired.salaryMin}K</span>-
                        <span id="salaryMax" style="margin-right: 50px">${requestScope.positionDesired.salaryMax}K</span>
                        <span id="industryId" style="margin-right: 50px">${requestScope.positionDesired.industry.industryName}</span>
                        <span id="cityId" style="margin-right: 50px">${requestScope.positionDesired.city.cityName}</span>
                    </c:if>
                </span>
            </td>
            <td>
                <c:if test="${requestScope.positionDesired!=null}">
                    <img id="del5${sessionScope.person.id}" src="<%=path%>/static/images/web/del.png" style="width: 20px;padding-top: 40px;" title="删除" >
                </c:if>
            </td>
        </tr>
        <tr>
            <td colspan="8">
                <h5>更改期望职位</h5>
                <ul>
                    <li >
                        <form>
                            <select name="jQuery2" class="beautify_input" id="selectPositionType" required>
                                <option>职位类型</option>
                                <c:forEach items="${requestScope.allPositionType}" var="positionType" varStatus="x">
                                    <option value="${x.count}">
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            ${positionType.positionTypeName}
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    </option>
                                </c:forEach>
                            </select><br><br><br>

                            <select name="jQuery2" class="beautify_input" id="selectPosition" required>
                                <option>职位</option>
                                <c:forEach items="${requestScope.allPosition}" var="position" varStatus="x">
                                    <option value="${x.count}">
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            ${position.positionName}
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    </option>
                                </c:forEach>
                            </select><br><br><br>

                            最低薪资:<input type="number" id="minp" style="margin-right: 10px;margin-left: 10px;" required>K<br><br><br>
                            最高薪资:<input type="number" id="maxp" style="margin-right: 10px;margin-left: 10px;" required>K<br><br><br>

                            <select name="jQuery2" class="beautify_input" id="selectIndustry" required>
                                <option>行业</option>
                                <c:forEach items="${requestScope.allindustry}" var="industry" varStatus="x">
                                    <option value="${x.count}">
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            ${industry.industryName}
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    </option>
                                </c:forEach>
                            </select><br><br><br>

                            <select name="jQuery2" class="beautify_input" id="selectCity" required>
                                <option>城市</option>
                                <c:forEach items="${requestScope.allcity}" var="city" varStatus="x">
                                    <option value="${x.count}">
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            ${city.cityName}
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    </option>
                                </c:forEach>
                            </select><br><br><br>
                            <input type="submit" id="sbmit1" style="margin-left: 150px;">
                        </form>
                    </li>
                </ul>
            </td>
        </tr>
        <tr>
            <td colspan="7">
                <b>项目经历</b>
                <br><br>
                <c:if test="${requestScope.projectExp!=null}">
                    <c:forEach items="${requestScope.projectExp}" varStatus="x" var="proExp">
                    <span>
                    项目${x.count}.
                    项目名称：<span class="proExpName" style="margin-right: 50px">${proExp.name}</span>
                    角色：<span class="proExpRole" style="margin-right: 50px">${proExp.role}</span>
                    网址：<span class="proExpUrl" style="margin-right: 50px">${proExp.url}</span>
                    项目起止时间：<span class="startAndEndTime">
                        <fmt:formatDate value="${proExp.startTime}"></fmt:formatDate>-
                        <fmt:formatDate value="${proExp.endTime}"></fmt:formatDate>
                        </span>
                        <img class="del6${proExp.id}" src="<%=path%>/static/images/web/del.png" style="width: 20px;padding-top: 0px;" title="删除" ><br>
                    项目描述：<span class="proExpDescribe">${proExp.describe}</span><br>
                    业绩：<span class="proExpAchievement">${proExp.achievement}</span>

                    <br><hr><br>
                    </span>
                    </c:forEach>
                </c:if>
            </td>
        </tr>
        <tr>
            <td colspan="8">
                <h5>添加项目</h5>
                <ul>
                    <li>
                        <form>
                            项目名称：<input type="text" id="proExpName" required><br><br>
                            角色：<input type="text" id="proExpRole" required><br><br>
                            网址：<input type="text" id="proExpUrl" required><br><br>

                            开始时间：<input type="date" style="width: 250px" id="sT1" required><br><br>
                            完成时间：<input type="date" style="width: 250px" id="gT1" required><br><br><br>

                            项目描述：<textarea rows="3" cols="150" maxlength="200" placeholder="" id="proExpDescribe" required></textarea><br><br>
                            业绩：<textarea rows="3" cols="150" maxlength="200" placeholder="" id="proExpAchievement" required></textarea><br><br>

                            <input type="submit" id="sbmit2" style="margin-left: 150px;">
                        </form>
                    </li>
                </ul>
            </td>
        </tr>
        <tr>
            <td colspan="7">
                <b>工作经历</b>
                <br><br>
                <c:if test="${requestScope.workExp!=null}">
                    <c:forEach items="${requestScope.workExp}" varStatus="x" var="workExp">
                    <span>
                        工作${x.count}<%--是否是实习--%>
                        <c:if test="${workExp.isPractice==true}">
                            (实习)
                        </c:if><br><br>
                        公司名称:<span class="companyName" style="margin-right: 50px">${workExp.companyName}</span>
                        行业:<span class="industryId" style="margin-right: 50px">${workExp.industry.industryName}</span><br><br>
                        所属部门:<span class="department" style="margin-right: 50px">${workExp.department}</span>
                        职位名称:<span class="positionId" style="margin-right: 50px">${workExp.position.positionName}</span>
                        职位类型:<span class="positionTypeId" style="margin-right: 50px">${workExp.positionType.positionTypeName}</span>
                        工作时间:<span class="workTime" style="margin-right: 0px">${workExp.workTime}</span>年
                        <img class="del7${workExp.id}" src="<%=path%>/static/images/web/del.png" style="width: 20px;padding-top: 0px;" title="删除" ><br><br>
                        工作内容:<span class="workContent" style="margin-left: 50px;">${workExp.workContent}</span><br><br>
                        工作业绩:<span class="workAchievement" style="margin-right: 50px">${workExp.workAchievement}</span><br>
                        <hr><br>
                    </span>
                    </c:forEach>
                </c:if>
            </td>
        </tr>
        <tr>
            <td colspan="8">
                <h5>添加工作经历</h5>
                <ul>
                    <li>
                        <form>
                            是否实习:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <input name="sx" class="sx" type="radio" checked value="1">是&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <input name="sx" class="sx" type="radio" value="0">否<br><br>
                            公司名称:<input type="text" id="companyName" required><br><br>
                            <select name="jQuery2" class="beautify_input" id="selectIndustry1" required>
                                <option>行业</option>
                                <c:forEach items="${requestScope.allindustry}" var="industry" varStatus="x">
                                    <option value="${industry.id}">
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            ${industry.industryName}
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    </option>
                                </c:forEach>
                            </select><br><br><br>
                            所属部门:<input type="text" id="department" required><br><br>
                            <select name="jQuery2" class="beautify_input" id="selectPosition1" required>
                                <option>职位</option>
                                <c:forEach items="${requestScope.allPosition}" var="position" varStatus="x">
                                    <option value="${position.id}">
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            ${position.positionName}
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    </option>
                                </c:forEach>
                            </select><br><br><br>
                            <select name="jQuery2" class="beautify_input" id="selectPositionType1" required>
                                <option>职位类型</option>
                                <c:forEach items="${requestScope.allPositionType}" var="positionType" varStatus="x">
                                    <option value="${x.count}">
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            ${positionType.positionTypeName}
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    </option>
                                </c:forEach>
                            </select><br><br><br>
                            工作时间:<input type="number" id="workTime" required>年<br><br>
                            工作内容:<textarea rows="3" cols="150" maxlength="2000" placeholder="" id="workContent" required></textarea><br><br>
                            工作业绩:<textarea rows="3" cols="150" maxlength="200" placeholder="" id="workAchievement" required></textarea><br><br>
                            <input type="submit" id="sbmit3" style="margin-left: 150px;">
                        </form>
                    </li>
                </ul>
            </td>
        </tr>
        <tr>
            <td colspan="7">
                <b>技能标签</b>
                <br><br>
                <c:if test="${requestScope.skillLabelInfo!=''}">
                    <c:forEach items="${requestScope.skillLabelInfo}" varStatus="x" var="skillLabel">
                        <span>
                        <span class="skillLabelId">${skillLabel.skillLabelId}</span>
                        <img class="del8${skillLabel.id}" src="<%=path%>/static/images/web/del.png" style="width: 20px;margin-right: 30px;" title="删除" >
                        </span>
                    </c:forEach>
                </c:if>

            </td>
        </tr>
        <tr>
            <td colspan="8">
                <h5>选择技能标签</h5>
                <ul>
                    <li><form>
                        <c:if test="${requestScope.skillLabels!=null}">
                            <c:forEach items="${requestScope.skillLabels}" varStatus="x" var="skillLabel">
                                <input type="checkbox" id="sl${skillLabel.id}" value="${skillLabel.id}">${skillLabel.skillLabelName}
                                &nbsp;&nbsp;&nbsp;&nbsp;
                            </c:forEach>
                        </c:if><br><br>
                        <input type="submit" id="submit4">
                    </form></li>
                </ul>
            </td>
        </tr>
        <tr>
            <td colspan="6">
                <b>资格证书</b>
                <br><br>
                <c:if test="${requestScope.credentials!=null}">
                    <span id="credential">${requestScope.credentials}</span>
                </c:if>
            </td>
            <td>
                <c:if test="${requestScope.credentials!=null}">
                    <img id="del2${sessionScope.person.id}" src="<%=path%>/static/images/web/del.png" style="width: 20px;padding-top: 40px;" title="删除" >
                </c:if>
            </td>
        </tr>
        <tr>
            <td colspan="8">
                <h5>编辑资格证书</h5>
                <ul>
                    <li>
                        <textarea rows="1" cols="150" maxlength="50" placeholder="" id="credentials">
                        </textarea>
                    </li>
                </ul>
            </td>
        </tr>
        </tbody>
    </table>
</div>



</body>
<script type="text/javascript" src="<%=path%>/static/js/jquery-3.4.1.min.js"></script>
<script type="text/javascript" src="<%=path%>/static/js/web/bootstrap-table-expandable.js"></script>

<script type="text/javascript" src="<%=path%>/static/js/web/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="<%=path%>/static/js/web/jquery.cssforms.js"></script>
<script type="text/javascript">
    $(function(){
        $('.beautify_input').cssSelect();
    });
</script>

<script type="text/javascript">
    var path="${pageContext.servletContext.contextPath}";
    var birth="<fmt:formatDate value="${sessionScope.person.birth}"></fmt:formatDate>";
    $(function () {
        var age=jsGetAge(birth);
        $("#age").html(age);
        /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
        //获取学校类型值
        /*$(".schoolId").each(function () {
            var id=$(this).html();
            //alert($(this).html());
            $.get(path+"/web/person/getSchoolName",{id:id}, function (schoolName) {
                $(this).html(schoolName);
            }.bind(this))
        });*/
        /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
        //获取学历类型值
        /*$(".eduTypeId").each(function () {
            var id=$(this).html();
            //alert($(this).html());
            $.get(path+"/web/person/getEduTypeName",{id:id}, function (eduTypeName) {
                $(this).html(eduTypeName);
            }.bind(this))
        });*/
        /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/

        //获取行业
        /*$(".industryId").each(function () {
            var id=$(this).html();
            //alert($(this).html());
            $.get(path+"/web/person/getIndustryName",{industryId:id}, function (data) {
                $(this).html(data);
            }.bind(this))
        });*/
        //获取职位类型名称
        /* $(".positionTypeId").each(function () {
             var id=$(this).html();
             //alert($(this).html());
             $.get(path+"/web/person/getPositionTypeName",{positionTypeId:id}, function (data) {
                 $(this).html(data);
             }.bind(this))
         });*/
        //获取职位名称
        /*$(".positionId").each(function () {
            var id=$(this).html();
            //alert($(this).html());
            $.get(path+"/web/person/getPositionName",{positionId:id}, function (data) {
                $(this).html(data);
            }.bind(this))
        });*/
        //获取技能标签
        $(".skillLabelId").each(function () {
            var id=$(this).html();
            //alert($(this).html());
            $.get(path+"/web/person/getSkillLabelName",{skillLabelId:id}, function (data) {
                $(this).html(data);
            }.bind(this))
        });
        /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
        /*+++++++++++++++++++++++++++++++++++++++++++++++期望职位++++++++++*/

        //获取职位类型值
        /*var positionTypeId=$("#positionTypeId").text();
        //alert(id);
        $.get(path+"/web/person/getPositionTypeName",{positionTypeId:positionTypeId}, function (data) {
            $("#positionTypeId").html(data);
        });*/

        //获取职位名称
        /*  var positionId=$("#positionId").text();
          //alert(id);
          $.get(path+"/web/person/getPositionName",{positionId:positionId}, function (data) {
              $("#positionId").html(data);
          });*/

        //获取行业值
        /*var industryId=$("#industryId").text();
        //alert(id);
        $.get(path+"/web/person/getIndustryName",{industryId:industryId}, function (data) {
            $("#industryId").html(data);
        });*/

        //获取城市
        /* var cityId=$("#cityId").text();
         //alert(id);
         $.get(path+"/web/person/getCityName",{cityId:cityId}, function (data) {
             $("#cityId").html(data);
         });*/
        /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
    });
    /*根据出生日期算出年龄*/
    function jsGetAge(strBirthday){
        var returnAge;
        var strBirthdayArr=strBirthday.split("-");
        var birthYear = strBirthdayArr[0];
        var birthMonth = strBirthdayArr[1];
        var birthDay = strBirthdayArr[2];

        d = new Date();
        var nowYear = d.getFullYear();
        var nowMonth = d.getMonth() + 1;
        var nowDay = d.getDate();

        if(nowYear == birthYear){
            returnAge = 0;//同年 则为0岁  
        }
        else{
            var ageDiff = nowYear - birthYear ; //年之差  
            if(ageDiff > 0){
                if(nowMonth == birthMonth) {
                    var dayDiff = nowDay - birthDay;//日之差  
                    if(dayDiff < 0)
                    {
                        returnAge = ageDiff - 1;
                    }
                    else
                    {
                        returnAge = ageDiff ;
                    }
                }
                else
                {
                    var monthDiff = nowMonth - birthMonth;//月之差  
                    if(monthDiff < 0)
                    {
                        returnAge = ageDiff - 1;
                    }
                    else
                    {
                        returnAge = ageDiff ;
                    }
                }
            }
            else
            {
                returnAge = -1;//返回-1 表示出生日期输入错误 晚于今天  
            }
        }
        return returnAge;//返回周岁年龄  
    }

    /*==========================================================================================================*/
    $("#advantages").blur(function () {
        //alert($(this).val())
        var resumeId=${sessionScope.resumeId};
        var personId=${sessionScope.person.id};
        var data=$(this).val().trim();
        //alert(resumeId)
        //alert(data)

        if (data==""||data==null){
            return;
        }
        $.get(path+"/web/person/personAdvantage",{personId:personId,id:resumeId,advantages:data});
        $("[id^='del1']").width(20);
        $("#advantage").text(data);

    });
    //删除  #advantages  #del1
    $("[id^='del1']").on("click",function () {
        if ("${requestScope.advantages}"==""){return;}
        var b=confirm("确认要删除吗？");
        if (!b){return;}
        var id=$(this).attr("id").substring(4);
        //alert(id)
        $.get(path+"/web/person/personDel1",{id:id});
        $(this).width(0);
        $("#advantage").html("");
    });
    /*=============================================================================================*/
    $("#credentials").blur(function () {
        //alert($(this).val())
        var personId=${sessionScope.person.id};
        var resumeId=${sessionScope.resumeId};
        var data=$(this).val().trim();
        if (data==""||data==null){
            return;
        }
        $.get(path+"/web/person/personCredentials",{id:resumeId,personId:personId,credentials:data});
        $("[id^='del2']").width(20);
        $("#credential").append(data);
    });
    //删除  #  #del2
    $("[id^='del2']").on("click",function () {
        if ("${requestScope.credentials}"==""){return;}
        var b=confirm("确认要删除吗？");
        if (!b){return;}
        var id=$(this).attr("id").substring(4);
        //alert(id)
        $.get(path+"/web/person/personDel2",{id:id});
        $(this).width(0);
        $("#credential").html("");
    });
    /*=================================================================selectEducation============================*/
    $("#selectEducation").change(function () {
        //alert($(this).val())
        var educationtype=$(this).find("option:selected").text();
        //alert(educationtype)
        var educationtypeId=$(this).val();
        var personId=${sessionScope.person.id};
        $.get(path+"/web/person/personEducation",{educationtypeId:educationtypeId,personId:personId});
        $("#education").text(educationtype);
    });
    //删除  #  #del3
    $("[id^='del3']").on("click",function () {
        if ("${requestScope.education}"==""){return;}
        var b=confirm("确认要删除吗？");
        if (!b){return;}
        var id=${sessionScope.person.id};
        //alert(id)
        $.get(path+"/web/person/personDel3",{id:id});
        $(this).width(0);
        $("#education").html("");
    });
    /*======================================================================教育经历=======================*/

    $("#sbmit").click(function () {
        //var schoolName=$("#selectSchool").find("option:selected").text();
        var personId=${sessionScope.person.id};
        var schoolName=$("#selectSchool").val();
        var startTime=$("#sT").val();
        var graduationTime=$("#gT").val();
        var associationActivity=$("#as").val();
        var isFullTime =$(".sf").prop("checked");
        if (isFullTime==true){isFullTime=1}
        if (isFullTime==false){isFullTime=0}
        var professionalName=$("#pn").val();
        var selectEducation=$("#selectEducation").val();
        var data={personId:personId,schoolName:schoolName,startTime:startTime,graduationTime:graduationTime,associationActivity:associationActivity,
            isFullTime:isFullTime,professionalName:professionalName,selectEducation:selectEducation}

        /*alert(startTime.replace(/\-/g, "\/"))
        alert(graduationTime.replace(/\-/g, "\/"))
        alert(startTime.replace(/\-/g, "\/")>=graduationTime.replace(/\-/g, "\/"))*/
        if (schoolName=="添加学校" && selectEducation=="学历"){alert("请全部填写！");return false;}
        if (startTime.replace(/\-/g, "\/")>=graduationTime.replace(/\-/g, "\/")){
            alert("时间填写错误！");return false;
        }
        $.get(path+"/web/person/personEducationExp",data);

    });

    //删除  #  #del4
    $("[class^='del4']").on("click",function () {
        if ("${requestScope.educationalExperience}"==""){return;}
        var b=confirm("确认要删除吗？");
        if (!b){return;}
        var id=$(this).attr("class").substring(4);
        //alert(id)
        $.get(path+"/web/person/personDel4",{id:id});
        $(this).width(0);
        $(this).parent().remove();
    });
    /*==================================================================期望职位===========================*/
    //position  del5
    $("[id^='del5']").on("click",function () {
        if ("${requestScope.positionDesired}"==null){return;}
        var b=confirm("确认要删除吗？");
        if (!b){return;}
        var id=${sessionScope.person.id};
        //alert(id)
        $.get(path+"/web/person/personDel5",{id:id});
        $(this).width(0);
        $("#position").html("");
    });

    $("#sbmit1").click(function () {
        var personId=${sessionScope.person.id};
        var positionTypeId=$("#selectPositionType").val();
        var positionId=$("#selectPosition").val();
        var minp=$("#minp").val();
        var maxp=$("#maxp").val();
        var industryId=$("#selectIndustry").val();
        var cityId=$("#selectCity").val();

        var data={personId:personId,positionTypeId:positionTypeId,positionId:positionId,
            minp:minp,maxp:maxp,industryId:industryId,cityId:cityId
        }
        //alert(positionTypeId)
        //alert(positionId)
        if (positionTypeId=="职位类型" ) {alert("请填写职位类型！");return false;}
        if (positionId=="职位" ) {alert("请填写职位！");return false;}
        if (industryId=="行业" ) {alert("请填写行业！");return false;}
        if (cityId=="城市" ) {alert("请填写城市！");return false;}

        if (maxp<minp){alert("薪资填写有误！");return ;}
        $.get(path+"/web/person/personPositionDesired",data);

    });
    /*=========================================================================项目经历====================*/
    //删除  #  #del6
    $("[class^='del6']").on("click",function () {
        if ("${requestScope.projectExp==""}"==""){return;}
        var b=confirm("确认要删除吗？");
        if (!b){return;}
        var id=$(this).attr("class").substring(4);
        //alert(id)
        $.get(path+"/web/person/personDel6",{id:id});
        $(this).width(0);
        $(this).parent().remove();
    });

    $("#sbmit2").click(function () {
        var personId=${sessionScope.person.id};
        var proExpName=$("#proExpName").val();
        var proExpRole=$("#proExpRole").val();
        var proExpUrl=$("#proExpUrl").val();
        var sT1=$("#sT1").val();
        var gT1=$("#gT1").val();
        var proExpDescribe=$("#proExpDescribe").val();
        var proExpAchievement=$("#proExpAchievement").val();
        var data={personId:personId,proExpName:proExpName,proExpRole:proExpRole,proExpUrl:proExpUrl,sT1:sT1,
            gT1:gT1,proExpDescribe:proExpDescribe,proExpAchievement:proExpAchievement}

        $.get(path+"/web/person/personProjectExp",data);
    });
    /*================================================================================工作经历=============*/
    //删除  #  #del7
    $("[class^='del7']").on("click",function () {
        if ("${requestScope.workExp==""}"==""){return;}
        var b=confirm("确认要删除吗？");
        if (!b){return;}
        var id=$(this).attr("class").substring(4);
        //alert(id)
        $.get(path+"/web/person/personDel7",{id:id});
        $(this).width(0);
        $(this).parent().remove();
    });

    $("#sbmit3").click(function () {
        var personId=${sessionScope.person.id};
        var isPractice =$(".sx").prop("checked");
        var companyName=$("#companyName").val();
        var industryId=$("#selectIndustry1").val();
        var department=$("#department").val();
        var positionId=$("#selectPosition1").val();
        var positionTypeId=$("#selectPositionType1").val();
        var workTime=$("#workTime").val();
        var workContent=$("#workContent").val();
        var workAchievement=$("#workAchievement").val();

        var data={personId:personId,positionTypeId:positionTypeId,positionId:positionId,
            isPractice:isPractice,companyName:companyName,industryId:industryId,department:department,
            workTime:workTime,workContent:workContent,workAchievement:workAchievement
        }
        //alert(positionTypeId)
        //alert(positionId)
        if (positionTypeId=="职位类型" ) {alert("请填写职位类型！");return false;}
        if (positionId=="职位" ) {alert("请填写职位！");return false;}
        if (industryId=="行业" ) {alert("请填写行业！");return false;}
        $.get(path+"/web/person/personWorkExp",data);
    })
    /*========================================================================技能标签=====================*/
    //删除  #  #del8
    $("[class^='del8']").on("click",function () {
        if ("${requestScope.skillLabelInfo==""}"==""){return;}
        var b=confirm("确认要删除吗？");
        if (!b){return;}
        var id=$(this).attr("class").substring(4);
        //alert(id)
        $.get(path+"/web/person/personDel8",{id:id});
        $(this).width(0);
        $(this).parent().remove();
    });
    $("#submit4").click(function () {
        var ids=new Array();

        $("input[type=checkbox]:checked").each(function () {
            ids.push($(this).val());
        });
        //alert(ids.toString())
        var data={ids:ids.toString()}

        $.get(path+"/web/person/personSkillLabelInfo",data);
    })
    /*=============================================================================================*/

</script>
</html>
